package com.xiangyang.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@TableName(value = "department")
public class Department extends BaseEntity{
    @TableId(value = "department_id", type = IdType.AUTO)
    private Long departmentId;  //部门编号
    private String departmentName;    //部门名称
    private String describes;    //部门描述

    @Override
    public Long getId() {
        return getDepartmentId();
    }

    @Override
    public void setId(Long Id) {
        setDepartmentId(departmentId);
    }


    public void setDepartmentId(Long departmentId) {
        this.departmentId = departmentId;
        // 同步设置 BaseEntity 的 id
        super.setId(departmentId);
    }
}
